package de.hmm.hwip.configuration.api;


/**
 *  Interface for table: sys_device configuration service.
 * 
 * @author Johannes Mendel
 * @version 02.10.2012
 *
 */
public interface ISystemDeviceConf {

	/**
	 * function to get the query for getting system device by ID
	 * 
	 * @param id: primary key of system device
	 * @return query to get system device
	 */
	public String getQueryForSysDeviceByID(int sysDevId);
	
	/**
	 * function to get the query for getting system device by serial number and device_id_fk
	 * 
	 * @param device_id_fk device id foreign key
	 * @param sn: serial number of system device
	 * @return query to get system device
	 */
	public String getQueryForSysDeviceBySN(int device_id_fk, String sn);
	
	/**
	 * function to get the query for getting system device by device_id_fk and spot_id_fk
	 * 
	 * @param deviceID: foreign key of device_id_fk
	 * @param spotID: foreign key of spot_id_fk
	 * @return query to get system device
	 */
	public String getQueryForSysDevice(int deviceID, int spotID);
	
	/**
	 * function to get the query for setting system device
	 *  
	 * @param deviceID: foreign key of device_id_fk
	 * @param spotID: foreign key of spot_id_fk
	 * @param sn_addr: serial number of device
	 * @param specification: specification of device -> optional
	 * @param attribute: String[] attributes of device
	 * @return query to set system device
	 */
	public String getQueryForSetSysDevice(int deviceID, int spotID, String sn_addr, String specification, String[] attribute);
	
	/**
	 * function to get the query for setting system device
	 *  
	 * @param sysDevId: Sys_dev_id primary key 
	 * @param deviceID: foreign key of device_id_fk
	 * @param spotID: foreign key of spot_id_fk
	 * @param sn_addr: serial number of device
	 * @param specification: specification of device -> optional
	 * @param attribute: String[] attributes of device
	 * @return query to set system device
	 */
	public String getQueryForSetSysDevice(int sysDevId, int deviceIDFk, int spotID, String sn_addr, String specification, String[] attribute);
	
	/**
	 * function to get the query for updating system device
	 *  
	 * @param sysDevId: primary key of sys_dev_id
	 * @param deviceID: foreign key of device_id_fk
	 * @param spotID: foreign key of spot_id_fk
	 * @param sn_addr: serial number of device
	 * @param specification: specification of device -> optional
	 * @param attribute: String[] attributes of device
	 * @return query to update system device
	 */
	public String getQueryForUpdateSysDevice(int sysDevId, int deviceID, int spotID, String sn_addr, String specification, String[] attribute);
	
	/**
	 * function to get the query for deleting system device
	 *  
	 * @param deviceID: foreign key of device_id_fk
	 * @return query to delete system device
	 */
	public String getQeuryForDeleteSysDevice(int sysDevId);
	
	/**
	 * function to get the query for getting device 
	 *  
	 * @param radiotype: foreign key of rt_id_fk
	 * @param modeltype: model_type of device
	 * @return query to get device
	 */
	public String getQueryForDeviceId(int radiotype, String modeltype);
	
	/**
	 * function to get the query for updating system device
	 *  
	 * @param sysDevId: primary key of sysDevId
	 * @param attribute: String[] attributes of device
	 * @return query to update system device
	 */
	public String getQueryForUpdateSysDevice(int sysDevId, String[] attribute);
	
	/**
	 * function to get the query for updating system device
	 *  
	 * @param sysDevId: primary key of sysDevId
	 * @param spotId: spot_id_fk
	 * @return query to update spot_id_fk of system device
	 */
	public String getQueryForUpdateSpotSysDevice(int sysDevId, int spotId);
	
	/**
	 * function to get the query to look for entries in connected_devices
	 *  
	 * @param sysDevId: foreign key of sysDevId
	 * @return query to find scripts which are conncted to device
	 */
	public String getQueryForConDevLookUp(int sysDevId);
	
	/**
	 * function to get the query for getting all data from device by device_id 
	 *  
	 * @param deviceId: primary key of device_id
	 * @return query to get device
	 */
	public String getQueryForDeviceByDeviceId(int deviceId);
	
	/**
	 * function to get the query for getting all spot_ips
	 * 
	 * @return query to get all spot ips
	 */
	public String getQueryForSpotIps();
}
